package com.carrental.api.workbench.service;

import com.carrental.api.cms.service.ICmsCarService;
import com.carrental.api.oms.service.IOmsOrderService;
import com.carrental.api.pms.service.IPmsStoreService;
import com.carrental.api.ums.service.IUmsUserService;
import com.carrental.api.workbench.domain.WorkCount;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LiangYi
 * @since 2022/3/27 18:01
 */
@Service
public class WorkBenchService {

    @Autowired
    private ICmsCarService cmsCarService;

    @Autowired
    private IUmsUserService umsUserService;

    @Autowired
    private IOmsOrderService omsOrderService;

    @Autowired
    private IPmsStoreService pmsStoreService;

    /**
     * 统计数量
     * @return 数量
     */
    public WorkCount getServeCount(){
        WorkCount workCount=new WorkCount();
        workCount.setCarCount((long) cmsCarService.list().size());
        workCount.setOrderCount((long) umsUserService.list().size());
        workCount.setStoreCount((long) omsOrderService.list().size());
        workCount.setUserCount((long) pmsStoreService.list().size());
        return workCount;
    }
}
